﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Apoll.Util {
    public static class Log {

        public static void Write(string message) {
            StreamWriter sw = null;
            try {
                sw = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "\\DelphiLog.txt", true);
                sw.WriteLine(DateTime.UtcNow.ToString() + ": " + message);
                sw.Flush();
                sw.Close();
            } catch {

            }
        }

        public static void Write(Exception e) {
            Write(e.Message);
        }

        public static void Write(string message, Exception e) {
            Write(e.Message + " (" + message + ")");
        }
    }
}
